//
/******************************************************
        File name:    main.c
        Author:       Bitat (陆叁柒)
        Gitee :       https://gitee.com/bitat
        Email :       737166381@qq.com
        History:      2023/1/9
*******************************************************/


#include <stdio.h>
#include <string.h>
#include <unistd.h>

int main()
{
    char arr1[] = "Hello C language";
    char arr2[] = "****************";
    int left = 0;
    unsigned long right = strlen(arr1)-1;   //不报错 引用string头文件
    for(left = 0,right = strlen(arr1)-1;right >= left;left++,right--)
    {
        arr2[left] = arr1[left];
        arr2[right] = arr1[right];
        printf("%s\n",arr2);
        sleep(1);       //时间为s 引用unistd头文件
    }
    
    return 0;
}

//int main()
//{
//    char arr1[] = "Hello C language";
//    char arr2[] = "****************";
//    int left = 0;
//    unsigned long right = strlen(arr1)-1;   //不报错 引用string头文件
//    while(right >= left)
//    {
//        arr2[left] = arr1[left];
//        arr2[right] = arr1[right];
//        printf("%s\n",arr2);
//        sleep(1);       //时间为s 引用unistd头文件
//        left++;
//        right--;
//    }
//
//    return 0;
//}
